package com.tanhua.service;

import com.tanhua.dubbo.QuestionAPI;
import com.tanhua.interceptor.UserHolder;
import com.tanhua.vo.QuestionVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionService {

    @DubboReference
    private QuestionAPI questionAPI;

    public void saveOrUpdate(QuestionVo questionVo) {
        //1 获取userId
        Long userId = UserHolder.getUserId();
        //2 远程调用
        questionAPI.saveOrUpdate(userId,questionVo.getContent());
    }
}
